C++中怎么表示根号下的数字(用cmath中的sqrt()可以开根号) |
您所在的位置:网站首页 › 根号 有效数字 › C++中怎么表示根号下的数字(用cmath中的sqrt()可以开根号) |
sqrt(x) 就是对X去根号的值,需要引入#include “math.h”; sqrt(): 功 能: 一个非负实数的平方根 函数原型: 在VC6.0中的math.h头文件的函数原型为double sqrt(double); 说明:sqrt系Square Root Calculations(平方根计算),通过这种运算可以考验CPU的浮点能力。 例如: #include //这里的cmath等价于C的math.h #include using namespace std; int main() { double x=4.0,result; result=sqrt(x); cout |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |